import request from '@/utils/request'

export function getList(data) {
    return request({
        url: '/pc/project/pre_assembly/02_get_project_by_param',
        method: 'post',
        data
    })
}

export function getDicData(data) {
    return request({
        url: '/pc/project/pre_assembly/01_find_detail_by_dictionary_type',
        method: 'post',
        formData: data
    })
}

export function getTownData() {
    return request({
        url: '/pc/project/pre_assembly/13_get_all_town',
        method: 'post',
    })
}

export function getVillageData(data) {
    return request({
        url: '/pc/project/pre_assembly/09_get_region_list_by_parent_id',
        method: 'post',
        formData: data
    })
}

export function getListLandByRegionId(data) {
    return request({
        url: '/pc/project/pre_assembly/06_list_land_by_region_id',
        method: 'post',
        data
    })
}

export function add(data) {
    return request({
        url: '/pc/project/pre_assembly/03_insert_project',
        method: 'post',
        data,
        load: true
    })
}

export function del(data) {
    return request({
        url: '/pc/project/pre_assembly/05_delete_project',
        method: 'post',
        formData: data
    })
}

export function queryDetailById(data) {
    return request({
        url: '/pc/project/pre_assembly/07_get_project_detail',
        method: 'post',
        formData: data,
        load: true
    })
}


export function calculateArea(data) {
    return request({
        url: '/pc/project/pre_assembly/04_calculate_area',
        method: 'post',
        formData:data
    })
}

export function getProjectDetail(data) {
    return request({
        url: '/pc/project/pre_assembly/07_get_project_detail',
        method: 'post',
        formData:data,
    })
}

//修改项目预组装
export function updateProject(data) {
    return request({
        url: '/pc/project/pre_assembly/08_update_project',
        method: 'post',
        data,
    })
}

//查询所有区县

export function queryAllDistrict() {
    return request({
        url: '/pc/project/distribute/queryAllDistrict',
        method: 'post',
    })
}